<?php

require_once("../config/netease_config.php");
require_once("tblog.class.php");

function netease_get_username($access_token)
{
	$tblog_obj = new TBlog(CONSUMER_KEY, CONSUMER_SECRET, 
		$access_token['oauth_token'], $access_token['oauth_token_secret']);
	
	$me = $tblog_obj->verify_credentials();
	
	return $me['name'];
}

function netease_add_weibo($access_token, $content)
{
	$tblog = new TBlog(CONSUMER_KEY, CONSUMER_SECRET, 
		$access_token['oauth_token'], $access_token['oauth_token_secret']);
	
	$ret = $tblog->update($content);
	return $ret;
}
?>